package com.gitee.xmhzzz.component.common.dto;


import com.gitee.xmhzzz.component.common.enums.ErrorCode;
import com.gitee.xmhzzz.component.common.exception.DefaultBusinessException;

public class CommonExceptionRes extends BaseResult {
    /**
     * 异常类，消费者据此还原异常
     */
    private String exception;

    public CommonExceptionRes() {
        super();
    }

    public CommonExceptionRes(ErrorCode resCode) {
        super(resCode.getCode(), resCode.getMsg());
    }

    public CommonExceptionRes(DefaultBusinessException exception) {
        super(exception.getResponseCode(), exception.getMessage());
        this.exception = exception.getClass().getName();
    }

    public CommonExceptionRes(Integer code, String msg) {
        super(code, msg);
    }

    public String getException() {
        return exception;
    }

    public void setException(String exception) {
        this.exception = exception;
    }
}
